package com.tlxch.controller.teacher;

import com.tlxch.dto.TAssessdto;
import com.tlxch.pojo.TAssess;
import com.tlxch.result.PageResult;
import com.tlxch.result.Result;
import com.tlxch.server.teacher.TAssessService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Api(tags = "评估管理相关接口")
@Slf4j
@RestController
@RequestMapping("/teacher/assess")
public class TAssessController {

    @Autowired
    TAssessService tAssessService;

    @GetMapping("/stupage")
    @ApiOperation("综合信息分页查询")
    public Result<PageResult> page(TAssessdto tAssessdto){
        PageResult pageResult = tAssessService.pageQuery(tAssessdto);
        return Result.success(pageResult);
    }

    @PostMapping("/save")
    @ApiOperation("支持批量保存评估结果")
    public Result saveAssess(@RequestBody List<TAssess> tAssessList){
        tAssessService.saveAssess(tAssessList);
        return Result.success();
    }

    @GetMapping("/assessPage")
    @ApiOperation("评估记录分页查询")
    public Result<PageResult> assessPage(TAssessdto tAssessdto){
        PageResult pageResult = tAssessService.assessPage(tAssessdto);
        return Result.success(pageResult);
    }
}
